#ifndef _MICROGEN_POLYHEDRON_CXX_

#include "ms_polyhedron.h"

#define _MICROGEN_POLYHEDRON_CXX_

Polyhedron::Polyhedron()
{
	hasPoints		= false;
	hasHalfspace	= false;
	hasFacets		= false;
	
	Nf		= 0;
	Nf_vx	= 0;
	fc		= 0;
	Nvx		= 0;
	n		= 0;
	vx		= 0;
	dist	= 0;
	
}

//	int		Nf, *Nf_vx, **fc, Nvx;
//	double	**n, **vx, *dist;
Polyhedron::Polyhedron( const int N_vx, double ** X, const bool init )
{
	Nf		= 0;
	Nf_vx	= 0;
	fc		= 0;
	n		= 0;
	dist	= 0;
	hasHalfspace	= false;
	hasFacets		= false;

	/* Init point coordinates */
	hasPoints		= true;
	Nvx		= N_vx;
	vx		= new double * [ Nvx ];
	for(int i=0;i<Nvx;i++)
	{
		vx[i] = new double [ 3 ];
		memcpy(vx[i], X[i], sizeof(double)*3);
	}
	
	/* compute convex hull */
	if(init)	GetFacetDataFromPoints();
}


Polyhedron::Polyhedron( const int N_f, double ** N, double * d , const bool init )
{
	Nvx		= 0;
	vx		= 0;
	Nf_vx	= 0;
	fc		= 0;
	hasPoints		= false;

	
	/* Init halfspaces */
	Nf		= N_f;
	n		= new double * [ Nf ] ;
	dist	= new double [ Nf ];
	for(int i=0;i<Nvx;i++) {
		n[i] = new double [ 3 ];
		memcpy(n[i], N[i], sizeof(double)*3);
	}
	memcpy(dist, d, sizeof(double)*Nf);

	/* compute convex hull */
	if(init)	GetDataFromHalfspaces();
}


void	Polyhedron::getDataFromPoints()
{
	
}
void	Polyhedron::getDataFromHalfspaces();


#endif /* _MICROGEN_POLYHEDRON_CXX_ */

